home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
005
/
product.arc
/
MACRO35.LSP
< prev
next >
Wrap
Text File
|
1986-09-21
|
2KB
|
62 lines
(Defun C:Ctc ()
(Setvar "Cmdecho" 0)
(Setq BLIP (Getvar "Blipmode"))
(Setvar "Blipmode" 0)
(Setq R3 (Getreal "\nEnter fillet radius: "))
(Setq C1 (Osnap (Setq E1 (Osnap (Getpoint
"\nTouch 1st circle: ")"Nea"))"Cen"))
(Setq C2 (Osnap (Setq E2 (Osnap (Getpoint
"\nTouch 2nd circle: ")"Nea"))"Cen"))
(Setq CC (Distance C1 C2))
(Setq EE (Distance E1 E2))
(Setq A1 (Angle C1 C2))
(Setq R1 (Distance C1 E1))
(Setq R2 (Distance C2 E2))
(Setq Q (- CC (+ R1 R2)))
(If (< R3 Q)
(Progn
(Prompt "\nFillet radius must be at least ")
(Princ Q) (Setq R3 (Getreal ", new radius: "))
)
)
(If (> EE CC)
(Progn
(Setq X (- R3 R1))
(Setq Y (- R3 R2))
)
(Progn
(Setq X (+ R3 R1))
(Setq Y (+ R3 R2))
)
)
(Setq COSA (/ (- (+ (* X X) (* CC CC))
(* Y Y)) (* 2 X CC)))
(Setq B (* COSA X))
(Setq Z (- CC B))
(Setq B1 (Abs Z))
(Setq A (Sqrt (- (* X X) (* B B))))
(Setq A2 (Abs (Atan (/ A B))))
(Setq A3 (Atan (/ A B1)))
(Setq A4
(If (< EE CC)
(+ A1 A2)
(If (> Z 0)
(+ A1 Pi A3)
(- A1 A3)
)
)
)
(Command "Arc" "C"
(If (< EE CC)
(Polar C1 A4 X)
(Polar C2 A4 Y)
)
(If (< EE CC)
(Polar C1 A4 R1)
(Polar C2 (+ A4 Pi) R2)
)
(If (< EE CC) C2 C1)
)
(Setvar "Blipmode" BLIP)
)